package chpt09.testsync;

public class SyncPairCounter {
	private int x;
	private int y;
	private Object o1 = new Object();
	private Object o2 = new Object();
	public void incX() {
		synchronized (o1) {
			x++;
		}
	}
	public void incY() {
		synchronized (o2) {
			y++;	
		}
	}
	public int getX() {
		synchronized (o1) {
			return x;
		}
	}
	public int getY() {
		synchronized (o2) {
			return y;
		}
	}
	
}
